package com.ruoyi.monitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.monitor.mapper.MonitorLocationMapper;
import com.ruoyi.monitor.domain.MonitorLocation;
import com.ruoyi.monitor.service.IMonitorLocationService;

/**
 * 监控地点Service业务层处理
 * 
 * @author lh
 * @date 2025-04-16
 */
@Service
public class MonitorLocationServiceImpl implements IMonitorLocationService 
{
    @Autowired
    private MonitorLocationMapper monitorLocationMapper;

    /**
     * 查询监控地点
     * 
     * @param locationId 监控地点主键
     * @return 监控地点
     */
    @Override
    public MonitorLocation selectMonitorLocationByLocationId(Integer locationId)
    {
        return monitorLocationMapper.selectMonitorLocationByLocationId(locationId);
    }

    /**
     * 查询监控地点列表
     * 
     * @param monitorLocation 监控地点
     * @return 监控地点
     */
    @Override
    public List<MonitorLocation> selectMonitorLocationList(MonitorLocation monitorLocation)
    {
        return monitorLocationMapper.selectMonitorLocationList(monitorLocation);
    }

    /**
     * 新增监控地点
     * 
     * @param monitorLocation 监控地点
     * @return 结果
     */
    @Override
    public int insertMonitorLocation(MonitorLocation monitorLocation)
    {
        monitorLocation.setCreateTime(DateUtils.getNowDate());
        return monitorLocationMapper.insertMonitorLocation(monitorLocation);
    }

    /**
     * 修改监控地点
     * 
     * @param monitorLocation 监控地点
     * @return 结果
     */
    @Override
    public int updateMonitorLocation(MonitorLocation monitorLocation)
    {
        return monitorLocationMapper.updateMonitorLocation(monitorLocation);
    }

    /**
     * 批量删除监控地点
     * 
     * @param locationIds 需要删除的监控地点主键
     * @return 结果
     */
    @Override
    public int deleteMonitorLocationByLocationIds(Integer[] locationIds)
    {
        return monitorLocationMapper.deleteMonitorLocationByLocationIds(locationIds);
    }

    /**
     * 删除监控地点信息
     * 
     * @param locationId 监控地点主键
     * @return 结果
     */
    @Override
    public int deleteMonitorLocationByLocationId(Integer locationId)
    {
        return monitorLocationMapper.deleteMonitorLocationByLocationId(locationId);
    }
}
